
<meta charset="utf-8">

<div class="box" id="biz_CmsContent_conatainer">
	<div class="box-header with-border">
		<form id="searchForm" role="form" class="form-inline">
			<div class="form-group">
				<label for="title" >标题</label> 
				<input name="title" v-model="searchForm.title" type="text" placeholder="" class="form-control">
				<input name="cmsType" v-model="searchForm.cmsType" type="hidden" >
			</div>
			<button type="button" class="btn btn-info pull-right m-t-n-xs" v-on:click="search">
				<strong>查询</strong>
			</button>
		</form>
	</div>
	<div class="box-body">
		<div class="row">
			<div class="col-md-12">
				<div class="btn-group " id="CmsContentTableToolbar" role="group">
					
					
					<button type="button" v-kperms="{perm:''}" class="btn btn-default" v-on:click="add" v-if="searchForm.cmsType==10">
						<i class="glyphicon glyphicon-plus" aria-hidden="true"></i> 创建【资讯】
					</button>
					<button type="button" v-kperms="{perm:''}" class="btn btn-default" v-on:click="add"  v-if="searchForm.cmsType==11">
						<i class="glyphicon glyphicon-plus" aria-hidden="true"></i> 创建【开通说明】
					</button>

					<button type="button" v-kperms="{perm:''}" class="btn btn-default" v-on:click="add" v-if="searchForm.cmsType==12">
						<i class="glyphicon glyphicon-plus" aria-hidden="true"></i> 创建【常见问题】
					</button>
					
					
					<button type="button" v-kperms="{perm:''}" class="btn btn-default" v-on:click="edit">
						<i class="glyphicon glyphicon-pencil" aria-hidden="true"></i> 修改
					</button>
					
					<button type="button" v-kperms="{perm:''}" class="btn btn-default" v-on:click="setStatus(-1)">
						<i class="glyphicon glyphicon-trash" aria-hidden="true"></i> 删除
					</button>
					
					
				</div>
				<table id="CmsContentBootstrapTable" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
</div>
<script>

    
var CmsContent_list_main=new Vue({  
	  el: '#biz_CmsContent_conatainer',
	  data:{
		  searchForm:{
			  title: null,
			  cmsType: null,
		 },
		  bus:new Vue(),
	  },
	  mounted:function(){
		  var _this=this;
		  _this.searchForm.cmsType=zfesRoutie.getUrlPatam("cmsType");
		_this.initTable();
		 
		
	  },
    methods: {
  	  initTable:function(){
  		var _this=this;
  		  var columns=[
  					{checkbox:true,width:20},
  					{field:'title',title:'标题',width:200},
  					{field:'createTime',title:'时间',width:100},
					{field:'cmsType',title:'类别',width:40}]; 
  		  var url="/met/service/pub/metCmsContent/loadMetCmsContentDataSet";
    		zfesBstable.laodTable($("#CmsContentBootstrapTable"),$("#searchForm"),$("#CmsContentTableToolbar"),url,columns,this.searchForm);
  	  },
  	  search:function(){
  		  zfesBstable.reload($("#CmsContentBootstrapTable")); 
  	  },
  	  refresh:function(){
  		  zfesBstable.refresh($("#CmsContentBootstrapTable"));
  	  },
  	  add:function(){
  		 var　_this=this;
  		 var url="/views/admin/cms/cms.content.add.html";
  		 zfesLayerEditDg.open(url,{"cmsType":_this.searchForm.cmsType},"创建内容",960,function(){_this.refresh();});
  		 
  	  },
  	  edit:function(){
  		  if(zfesBstable.isOneRow($("#CmsContentBootstrapTable"))){
  			  var　_this=this;
  			  var id=zfesBstable.getRowId($("#CmsContentBootstrapTable"));
  			  var url="/views/admin/cms/cms.content.edit.html";
  			  zfesLayerEditDg.open(url,{"id":id},"项目信息编辑",960,function(){_this.refresh();}); 
  		 }
  	  },

  	deleteMettings: function(){
  		if(zfesBstable.isSelectedRow($("#CmsContentBootstrapTable"))){
			  var　_this=this;
			    var id=zfesBstable.getRowId($("#CmsContentBootstrapTable"));
				 alertSwal.confirm("删除","是否删除该项目",function(){
					    var ajaxUrl = "/met/service/admin/metCmsContent/deleteMetCmsContent";
						zfesAjax.ajaxTodo(ajaxUrl, { "id" : id,"status":-1}, function(data) {
							alertSwal.successText(data.message);
							_this.refresh();
						}); 
			});
		}
 	  },

   	
   }
});

</script>


